package com.woniuxy.factory;

/*
* 二代工厂
* */

import com.woniuxy.entity.Person;

public class SecondFactory {

    public Person doPerson(String nationality) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        try {
            return (Person) Class.forName(nationality).newInstance();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
